import React, { useEffect, useState } from 'react'
import '../../css/yym/Base.css'
import axios from '../../utool/axios'

export default function Base() {
    const [toilet, setToilet] = useState({})

    const getdata = async () => {
        let res = await axios.get('/yym/getToiletInfo')
        localStorage.setItem('statusInfo', JSON.stringify(res.data.data[0].itemStatus))
        setToilet(res.data.data[0])
    }

    useEffect(() => {
        getdata()
    }, [])
    return (
        <div id='base'>
            <div>
                编码:  {toilet.id}
            </div>
            <div>
                公厕名称:  {toilet.name}
            </div>
            <div>
                等级:  {toilet.level}
            </div>
            <div>
                建设日期:  {toilet.construction}
            </div>
            <div>
                开放日期:  {toilet.opening}
            </div>
            <div>
                管理单位:  {toilet.management}
            </div>
            <div>
                责任单位:{toilet.resp}
            </div>
            <div>
                厕所地址:  {toilet.addr}
            </div>
            <div>
                总蹲位(个):  {toilet.sum}
            </div>
            <div>
                男蹲位(个):  {toilet.man}
            </div>
            <div>
                小便池(个):  {toilet.pool}
            </div>
            <div>
                女蹲位(个):  {toilet.woman}
            </div>
        </div>
    )
}
